package pjn;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import com.aliasi.io.FileLineReader;

public class KnowledgeBase {
    public static Set<String> INVENTED_NAMES;
    public static Set<String> POSITIVE_QUALITIES;
    public static Set<String> NEGATIVE_QUALITIES;
    public static Set<String> PREPOSITIONS;

    static {
        try {
            INVENTED_NAMES = read("knowledge/inventedNames.txt");
            POSITIVE_QUALITIES = read("knowledge/positiveQualities.txt");
            NEGATIVE_QUALITIES = read("knowledge/negativeQualities.txt");
            PREPOSITIONS = read("knowledge/prepositions.txt");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static Set<String> read(String fileName) throws IOException {
        return new HashSet<String>(Arrays.asList(FileLineReader.readLineArray(new File(fileName), "UTF-8")));
    }
}
